home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1998 June / SGI IRIX 6.5 Applications 1998 June.iso / dist / arraysvcs.idb / usr / include / arraysvcs.h.z / arraysvcs.h
Encoding:
C/C++ Source or Header  |  1998-04-15  |  18.0 KB  |  525 lines

  1. #ifndef __ARRAYSVCS_H__
  2. #define __ARRAYSVCS_H__
  3.  
  4. /*
  5.  * arraysvcs.h
  6.  *
  7.  *    Interfaces for the array services library
  8.  *
  9.  * Copyright 1995, Silicon Graphics, Inc.
  10.  * ALL RIGHTS RESERVED
  11.  *
  12.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  13.  * States.   Use of a copyright notice is precautionary only and does not
  14.  * imply publication or disclosure.
  15.  *
  16.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  17.  * Use, duplication or disclosure by the Government is subject to restrictions
  18.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  19.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  20.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  21.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  22.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  23.  *
  24.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  25.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  26.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  27.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  28.  * GRAPHICS, INC.
  29.  */
  30. /*
  31.  *    (C) COPYRIGHT CRAY RESEARCH, INC.
  32.  *    UNPUBLISHED PROPRIETARY INFORMATION.
  33.  *    ALL RIGHTS RESERVED.
  34.  */
  35.  
  36. #ident "$Revision: 1.45 $"
  37.  
  38. /* USMID %Z%%M%    %I%    %G% %U% */
  39.  
  40. #if defined(_LANGUAGE_C_PLUS_PLUS)
  41. extern "C" {
  42. #endif
  43.  
  44. #include <sys/types.h>
  45. #include <netinet/in.h>
  46.  
  47. #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
  48.  
  49.  
  50. /*
  51.  * Basic types
  52.  */
  53. typedef uintptr_t    asserver_t;    /* Server token */
  54.  
  55. typedef uint64_t    askey_t;    /* Authentication key */
  56. #define AS_NOKEY    0        /* No key specified */
  57.  
  58. typedef uint16_t    asident_t;    /* Entity identifier */
  59.  
  60.  
  61.  
  62. /*
  63.  * error handling
  64.  *    Most array services store a result code in the global variable
  65.  *    "aserrorcode".  This result code may actually contain several
  66.  *    fields.  A general summary of the error code, similar to the
  67.  *    standard "errno", can be found in "aserrno".
  68.  */
  69.  
  70. /* Error code declarations */
  71. typedef __uint32_t aserror_t;
  72.  
  73. #define aserrnoc(E)    ((E) & 255)
  74. #define aserrwhatc(E)  (((E) >> 8) & 255)
  75. #define aserrwhyc(E)   (((E) >> 16) & 255)
  76. #define aserrextrac(E) ((E) >> 24)
  77.  
  78. extern aserror_t aserrorcode;
  79.  
  80. #define aserrno    (aserrnoc(aserrorcode))
  81. #define aserrwhat  (aserrwhatc(aserrorcode))
  82. #define aserrwhy   (aserrwhyc(aserrorcode))
  83. #define aserrextra (aserrextrac(aserrorcode))
  84.  
  85.  
  86. /* Error summary numbers */
  87. #define ASE_OK        0        /* Operation successful */
  88. #define ASE_SYSERROR    1        /* System operation failed */
  89. #define ASE_BADVALUE    2        /* Invalid value/argument */
  90. #define ASE_REQFAILED    3        /* Request failed */
  91. #define ASE_BADCOMMAND    4        /* Invalid command */
  92. #define ASE_PROTOCOL    5        /* Protocol error */
  93. #define ASE_INTERNAL    6        /* Internal error */
  94. #define ASE_NOARRAYSVCS 7        /* Array services not installed */
  95.  
  96. /* ASE_OK "why" codes ("what" is undefined) */
  97. #define ASOK_COMPLETED    0        /* Command/request completed */
  98. #define ASOK_INITIATED    1        /* Command started, may not be done */
  99. #define ASOK_CONNECT    2        /* Initiate connection */
  100. #define ASOK_CONNECTED    3        /* Connection completed */
  101.  
  102. /* ASE_NOARRAYSVCS has no "what" or "why" code */
  103.  
  104. /* ASE_SYSERROR "what" codes.  ("why" == errno) */
  105. #define ASSE_UNKNOWN    0        /* Origin unknown */
  106. #define ASSE_CMDFORK    1        /* Command process fork */
  107. #define ASSE_REQFORK    2        /* Request process fork */
  108. #define ASSE_WAIT    3        /* Wait for process */
  109. #define ASSE_SELECT    4        /* Wait for event */
  110. #define ASSE_READHDR    5        /* Read message header */
  111. #define ASSE_READBODY    6        /* Read message body */
  112. #define ASSE_WRITEHDR    7        /* Write message header */
  113. #define ASSE_WRITEBODY    8        /* Write message body */
  114. #define ASSE_GETASH    9        /* Extract ASH */
  115. #define ASSE_PIDSINASH    10        /* Extract PIDs in ASH */
  116. #define ASSE_ACCEPT    11        /* Accept client connection */
  117. #define ASSE_SOCKET    12        /* Create socket */
  118. #define ASSE_CONNECT    13        /* Connect to server */
  119. #define ASSE_SETSOCKOPT 14        /* Set socket options */
  120. #define ASSE_BIND    15        /* Bind name to socket */
  121. #define ASSE_LISTEN    16        /* Listen for connections */
  122. #define ASSE_WRITEOUT    17        /* Write output data */
  123. #define ASSE_OPENPROCD    18        /* Open procfs directory */
  124. #define ASSE_OPENOUT    19        /* Open output file */
  125. #define ASSE_STATOUT    20        /* Stat output file */
  126. #define ASSE_READOUT    21        /* Read output file */
  127. #define ASSE_ENUMASHS    22        /* Enumerate ASHs */
  128. #define ASSE_PEERNAME    23        /* Get peer name */
  129. #define ASSE_SOCKNAME    24        /* Get socket name */
  130. #define ASSE_STATUDS    25        /* Stat unix domain socket */
  131. #define ASSE_IOCTLNBIO    26        /* Make socket non-blocking */
  132. #define ASSE_GETSRVOPT  27        /* Get server option */
  133. #define ASSE_KILL    28        /* Send signal to process */
  134. #define ASSE_SETUID    29        /* Set user ID */
  135. #define ASSE_UNAME    30        /* Get OS information */
  136. #define ASSE_GETSPINFO    31        /* Get Service Provider Info */
  137. #define ASSE_ARSOP    32        /* Array Session Operation */
  138. #define ASSE_GETPRIO    33        /* Get scheduling priority */
  139. #define ASSE_GETRLIM    34        /* Get resource limit */
  140. #define ASSE_CHMOD    35        /* Change file permissions */
  141.  
  142. /* ASE_BADVALUE "what" codes */
  143. #define ASBV_UNKNOWN    0        /* Unknown value */
  144. #define ASBV_PORTNUM    1        /* Port number */
  145. #define ASBV_ARRAY    2        /* Array name */
  146. #define ASBV_HOST    3        /* Host name */
  147. #define ASBV_SRVTOKEN    4        /* Server token */
  148. #define ASBV_OPTNAME    5        /* Option name */
  149. #define ASBV_OPTVAL    6        /* Option value */
  150. #define ASBV_PID    7        /* Process ID */
  151. #define ASBV_DEST       8        /* Destination */
  152. #define ASBV_CONNECT    9        /* Connection info */
  153. #define ASBV_ADDRFAMILY 10        /* Address family */
  154. #define ASBV_OPTINFO    11        /* Options information */
  155. #define ASBV_ARGS    12        /* Command line arguments */
  156. #define ASBV_TARGET    13        /* Target of signal */
  157.  
  158. /* ASE_BADVALUE "why" codes */
  159. #define ASBVY_UNKNOWN    0        /* Do not know why */
  160. #define ASBVY_RANGE    1        /* Value out of range */
  161. #define ASBVY_PARSE    2        /* Cannot parse value */
  162. #define ASBVY_NOTFOUND    3        /* Value not found */
  163. #define ASBVY_SIZE    4        /* Size of value is invalid */
  164. #define ASBVY_INVALID    5        /* Value generally invalid */
  165. #define ASBVY_NODEFAULT 6        /* No default for unspecified value */
  166.  
  167. /* ASE_REQFAILED "why" codes  ("what" is undefined) */
  168. #define ASRFY_UNKNOWN    0        /* Do not know why */
  169. #define ASRFY_VERSION    1        /* Wrong version of arrayd */
  170. #define ASRFY_TIMEOUT    2        /* Timed out waiting for command */
  171. #define ASRFY_BADOS    3        /* Wrong version of IRIX */
  172. #define ASRFY_NOCONNECT    4        /* Unable to connect interactively */
  173. #define ASRFY_BADCLIENT 5        /* Client connection invalid */
  174. #define ASRFY_CONNECTTO 6        /* Interactive connection timed out */
  175. #define ASRFY_BADAUTH    7        /* Authentication error */
  176.  
  177. /* ASE_BADCOMMAND "why" codes ("what" is undefined) */
  178. #define ASBCY_UNKNOWN    0        /* Do not know why */
  179. #define ASBCY_NOTFOUND    1        /* Command not found */
  180. #define ASBCY_EMPTY    2        /* Nothing to INVOKE */
  181. #define ASBCY_BADUSER    3        /* Invalid USER */
  182. #define ASBCY_BADGROUP    4        /* Invalid GROUP */
  183. #define ASBCY_BADPROJ    5        /* Invalid PROJECT */
  184. #define ASBCY_ILLMERGE  6        /* MERGE illegal for request */
  185. #define ASBCY_NOINFO    7        /* No command info provided */
  186.  
  187. /* Error functions */
  188. aserror_t asmakeerror(int, int, int, int);
  189. void asperror(const char *, ...);
  190. const char *asstrerror(aserror_t);
  191.  
  192.  
  193. /* Destination flags */
  194. #define ASDST_NONE   0            /* Destination not specified */
  195. #define ASDST_LOCAL  1            /* Local machine only */
  196. #define ASDST_SERVER 2            /* Specified server only */
  197. #define ASDST_ARRAY  3            /* Specified array */
  198.  
  199.  
  200. /*
  201.  * Server functions
  202.  *    Most array commands take an optional "asserver_t" argument to
  203.  *    specify an array server other than the default. These functions
  204.  *    create/destroy these tokens and modify options associated with them.
  205.  */
  206. asserver_t asopenserver(const char *, int);
  207. void       ascloseserver(asserver_t);
  208.  
  209. int asdfltserveropt(int, void *, int *);
  210. int asgetserveropt(asserver_t, int, void *, int *);
  211. int assetserveropt(asserver_t, int, const void *, int);
  212.  
  213. /* Server option names */
  214. #define AS_SO_TIMEOUT    1    /* Response timeout value */
  215. #define AS_SO_CTIMEOUT    2    /* Connection timeout value */
  216. #define AS_SO_FORWARD    3    /* Forwarding on/off */
  217. #define AS_SO_LOCALKEY  4    /* Local authentication key */
  218. #define AS_SO_REMOTEKEY 5    /* Remote authentication key */
  219. #define AS_SO_PORTNUM    6    /* Port number (dflt only) */
  220. #define AS_SO_HOSTNAME    7    /* Host name (dflt only) */
  221.  
  222.  
  223. /*
  224.  * ASH functions
  225.  */
  226. ash_t asallocash(asserver_t, const char *);
  227. int   asashisglobal(ash_t);
  228. ash_t asashofpid(pid_t);
  229.  
  230. typedef struct aspidlist {
  231.     int    numpids;    /* Number of PIDs in list */
  232.     pid_t   *pids;        /* Array of PIDs */
  233. } aspidlist_t;
  234.  
  235. typedef struct asmachinepidlist {
  236.     int       numpids;    /* Number of PIDs in list */
  237.     pid_t       *pids;    /* Array of PIDs */
  238.     const char *machname;    /* Name of machine */
  239.     char       rsrvd[44];    /* reserved for expansion */
  240. } asmachinepidlist_t;
  241.  
  242. typedef struct asarraypidlist {
  243.     int        nummachines;    /* Number of machines in list */
  244.     asmachinepidlist_t **machines;    /* List of asmachpidlist_t's */
  245.     const char    *arrayname;    /* Name of array */
  246.     char        rsrvd[44];    /* reserved for expansion */
  247. } asarraypidlist_t;
  248.  
  249. aspidlist_t *aspidsinash(ash_t);
  250. aspidlist_t *aspidsinash_local(ash_t);
  251. asmachinepidlist_t *aspidsinash_server(asserver_t, ash_t);
  252. asarraypidlist_t *aspidsinash_array(asserver_t, const char *, ash_t);
  253.  
  254.  
  255. /*
  256.  * Array command functions
  257.  */
  258. typedef struct ascmdreq {
  259.     char     *array;    /* Name of target array */
  260.     uint32_t flags;        /* Option flags */
  261.     int     numargs;    /* Number of arguments */
  262.     char     **args;    /* Cmd arguments (ala argv) */
  263.     uint32_t ioflags;    /* I/O flags for interactive commands */
  264.  
  265.     char     rsrvd[100];    /* reserved for expansion: init to 0's */
  266. } ascmdreq_t;
  267.  
  268. #define ASCMDREQ_LOCAL        0x80000000    /* Do not broadcast to array */
  269. #define ASCMDREQ_NEWSESS    0x40000000    /* Start new array session */
  270. #define ASCMDREQ_OUTPUT        0x20000000    /* Collect output from cmd */
  271. #define ASCMDREQ_NOWAIT        0x10000000    /* Do not wait on command */
  272. #define ASCMDREQ_INTERACTIVE    0x08000000    /* Run interactively */ 
  273.  
  274. #define ASCMDIO_STDIN        0x80000000    /* Provide stdin to command */
  275. #define ASCMDIO_STDOUT        0x40000000    /* Provide stdout to command */
  276. #define ASCMDIO_STDERR        0x20000000    /* Provide stderr to command */
  277. #define ASCMDIO_SIGNAL        0x10000000    /* Send signals to command */
  278. #define ASCMDIO_OUTERRSHR    0x08000000    /* Provide stderr via stdout */
  279.  
  280. #define ASCMDIO_FULLIO        (ASCMDIO_STDIN  | \
  281.                  ASCMDIO_STDOUT | \
  282.                  ASCMDIO_STDERR | \
  283.                  ASCMDIO_SIGNAL)    /* Provide full I/O */
  284.  
  285.  
  286. typedef struct ascmdrslt {
  287.     char      *machine;    /* Name of responding machine */
  288.     ash_t      ash;        /* ASH of running command */
  289.     uint32_t  flags;    /* Result flags */
  290.     aserror_t error;    /* Error code for this command */
  291.     int      status;    /* Exit status */
  292.     char      *outfile;    /* Name of output file */
  293.  
  294.     uint32_t  ioflags;    /* I/O connections (see ascmdreq_t) */
  295.     int      stdinfd;    /* File descriptor for command's stdin */
  296.     int      stdoutfd;    /* File descriptor for command's stdout */
  297.     int      stderrfd;    /* File descriptor for command's stderr */
  298.     int      signalfd;    /* File descriptor for sending signals */
  299.  
  300.     /* stay tuned for future expansion */
  301. } ascmdrslt_t;
  302.  
  303. #define ASCMDRSLT_OUTPUT    0x80000000    /* Output available */
  304. #define ASCMDRSLT_MERGED    0x40000000    /* Output is merged */
  305. #define ASCMDRSLT_ASH        0x20000000    /* ASH is available */
  306. #define ASCMDRSLT_INTERACTIVE    0x10000000    /* I/O connections available */
  307.  
  308.  
  309. typedef struct ascmdrsltlist {
  310.     int    numresults;    /* Number of ascmdrslt_t's */
  311.     ascmdrslt_t **results;    /* Array of ascmdrslt_t pointers */
  312. } ascmdrsltlist_t;
  313.  
  314.  
  315. ascmdrsltlist_t *ascommand(asserver_t, const ascmdreq_t *);
  316.  
  317.  
  318. /*
  319.  * Remote execution functions
  320.  */
  321. int asrcmd(asserver_t, char *, char *, int *);
  322. int asrcmdv(asserver_t, char *, char **, int *);
  323.  
  324.  
  325.  
  326. /*
  327.  * aslist<> functions
  328.  *    These functions return a malloc'ed list of items of the specified
  329.  *    type containing configuration or status information. The corresponding
  330.  *    "asfree<>" functions may be used to release the storage allocated by
  331.  *    the "aslist<>" functions.
  332.  */
  333. typedef struct asarray {
  334.     const char *name;        /* Name of array */
  335.     int       numattrs;        /* Number of attribute strings */
  336.     const char **attrs;        /* List of attribute strings */
  337.     u_short       ident;        /* Array ID */
  338. } asarray_t;
  339.  
  340. typedef struct asarraylist {
  341.     int      numarrays;        /* Number of arrays in list */
  342.     asarray_t **arrays;        /* Array of asarray_t pointers */
  343. } asarraylist_t;
  344.  
  345. asarray_t *asgetdfltarray(asserver_t);
  346. asarraylist_t *aslistarrays(asserver_t);
  347.  
  348.  
  349. typedef struct asashlist {
  350.     int    numashs;        /* Number of ASHs in list */
  351.     ash_t   *ashs;            /* Array of ASHs */
  352. } asashlist_t;
  353.  
  354. asashlist_t *aslistashs(asserver_t, const char *, int Dest, uint32_t Flags);
  355. asashlist_t *aslistashs_array(asserver_t, const char *);
  356. asashlist_t *aslistashs_local(void);
  357. asashlist_t *aslistashs_server(asserver_t);
  358.  
  359. /* Control flags for aslistashs */
  360. #define ASLAF_NOLOCAL    0x00000001    /* Global ASHs only */
  361. #define ASLAF_NODUPS    0x00000002    /* Remove duplicate ASHs */
  362. #define ASLAF_NODUPES    0x00000002    /* (for compatibility) */
  363.  
  364.  
  365. typedef struct asmachine {
  366.     const char     *name;        /* Familiar name of machine */
  367.     const char     *hostname;    /* Network hostname of machine */
  368.     int           numattrs;    /* Number of attribute strings */
  369.     const char     **attrs;        /* List of attribute strings */
  370.     struct in_addr inaddr;        /* IP address of machine */
  371.     u_short           portnum;        /* Port # of array daemon */
  372.     asident_t      ident;        /* ID of array daemon */
  373. } asmachine_t;
  374.  
  375. typedef struct asmachinelist {
  376.     int    nummachines;        /* Number of machines in list */
  377.     asmachine_t **machines;        /* Array of asmachine_t pointers */
  378. } asmachinelist_t;
  379.  
  380. asmachinelist_t *aslistmachines(asserver_t, const char *ArrayName);
  381.  
  382.  
  383. /*
  384.  * asfree<> functions
  385.  *    These functions are used to release the storage allocated by other
  386.  *    libarray functions (e.g. the aslist<> functions)
  387.  */
  388. void asfreearray(asarray_t *, uint32_t);
  389. void asfreearraylist(asarraylist_t *, uint32_t);
  390. void asfreearraypidlist(asarraypidlist_t *, uint32_t);
  391. void asfreeashlist(asashlist_t *, uint32_t);
  392. void asfreecmdrslt(ascmdrslt_t *, uint32_t);
  393. void asfreecmdrsltlist(ascmdrsltlist_t *, uint32_t);
  394. void asfreemachine(asmachine_t *, uint32_t);
  395. void asfreemachinelist(asmachinelist_t *, uint32_t);
  396. void asfreemachinepidlist(asmachinepidlist_t *, uint32_t);
  397. void asfreepidlist(aspidlist_t *, uint32_t);
  398.  
  399. #define ASFLF_FREEDATA    0x80000000    /* Free individual list items */
  400. #define ASFLF_UNLINK    0x40000000    /* Unlink temporary files */
  401. #define ASFLF_CLOSEIO    0x20000000    /* Close I/O connections */
  402. #define ASFLF_CLOSESRV    0x10000000    /* Close server token */
  403.  
  404.  
  405. /*
  406.  * Option parsing functions
  407.  *    Used by array services clients to provide a standard set of
  408.  *    command line options.
  409.  */
  410. typedef struct asoptinfo {
  411.     int    argc;        /* Number of unparsed arguments */
  412.     char    **argv;        /* Array of ptrs to unparsed arguments */
  413.  
  414.     int    valid;        /* Bitmap of valid fields */
  415.     int    invalid;    /* Bitmap of fields with invalid arguments */
  416.     int    options;    /* Option flags */
  417.  
  418.     asserver_t token;    /* Token for specified server */
  419.  
  420.     char    *server;    /* ASCII name of target server */
  421.     char    *array;        /* Name of array to operate on */
  422.     askey_t    localkey;    /* Local authentication key */
  423.     askey_t remotekey;    /* Remote authentication key */
  424.     ash_t    ash;        /* ASH to operate on */
  425.     pid_t    pid;        /* PID to operate on */
  426.     int    portnum;    /* Port number of arrayd */
  427.     int    timeout;    /* Response timeout in seconds */
  428.     int    connectto;    /* Connect timeout in seconds */
  429.     int    verbose;    /* Verbose level */
  430. } asoptinfo_t;
  431.  
  432. /* Select/Valid flags */
  433. #define ASOIV_TOKEN    0x00000001    /* Server token */
  434. #define ASOIV_SERVER    0x00000002    /* Server name */
  435. #define ASOIV_ARRAY    0x00000004    /* Array name */
  436. #define ASOIV_LCLKEY    0x00000008    /* Local authentication key */
  437. #define ASOIV_REMKEY    0x00000010    /* Remote authentication key */
  438. #define ASOIV_ASH    0x00000020    /* Array session handle */
  439. #define ASOIV_PID    0x00000040    /* Process ID */
  440. #define ASOIV_PORTNUM    0x00000080    /* Port number */
  441. #define ASOIV_TIMEOUT    0x00000100    /* Timeout */
  442. #define ASOIV_CONNECTTO 0x00000200    /* Connect timeout */
  443. #define ASOIV_VERBOSE    0x00000400    /* Verbose level */
  444. #define ASOIV_FORWARD    0x00000800    /* Forwarding mode */
  445. #define ASOIV_LOCAL    0x00001000    /* Local mode */
  446.  
  447. #define ASOIV_STD    (ASOIV_SERVER | ASOIV_ARRAY | ASOIV_LCLKEY | \
  448.              ASOIV_REMKEY | ASOIV_PORTNUM | ASOIV_TIMEOUT | \
  449.              ASOIV_CONNECTTO | ASOIV_FORWARD)
  450.  
  451. /* Option flags */
  452. #define ASOIO_LOCAL    0x00000001    /* Local machine only */
  453. #define ASOIO_FORWARD    0x00000002    /* Forward request via local server */
  454.  
  455. /* Control flags */
  456. #define ASOIC_LOGERRS    0x00000001    /* Print error messages */
  457. #define ASOIC_NODUPS    0x00000002    /* Do not allow redundant args */
  458. #define ASOIC_OPTSONLY    0x00000004    /* Stop at first non-option arg */
  459. #define ASOIC_SELONLY    0x00000008    /* Stop at first unselected arg */
  460.  
  461. void asfreeoptinfo(asoptinfo_t *, uint32_t);
  462. asserver_t  asopenserver_from_optinfo(const asoptinfo_t *);
  463. asoptinfo_t *asparseopts(int argc, char **argv, int select, int control);
  464.  
  465.  
  466. /* Signal functions */
  467. int askillpid_server(asserver_t, pid_t, int signum);
  468.  
  469. int askillash_array(asserver_t, const char *array, ash_t, int signum);
  470. int askillash_local(ash_t, int signum);
  471. int askillash_server(asserver_t, ash_t, int signum);
  472.  
  473.  
  474. /*
  475.  * Constants pertaining to ASH's and PRID's
  476.  */
  477. #ifndef lint
  478. #  ifndef CRAY
  479. #define ASBADASH    -1LL    /* An invalid Array Session Handle */
  480. #define ASMINASH    0LL    /* Smallest valid Array Session Handle */
  481. #define ASNOASH        0LL    /* "No ASH specified" */
  482. #define ASASHMASK    0x7FFFFFFFFFFFFFFFLL    /* Valid ASH bits */
  483.  
  484. #define ASBADPRID    -1LL    /* An invalid project ID */
  485. #define ASMINPRID    0LL    /* Smallest valid project ID */
  486. #define ASNOPRID    0LL    /* "No project ID specified" */
  487. #  else
  488. /*
  489.  * CRAY doesn't have a long long type - longs are 64 bits though
  490.  */
  491. #define ASBADASH    -1L    /* An invalid Array Session Handle */
  492. #define ASMINASH    0L    /* Smallest valid Array Session Handle */
  493. #define ASNOASH        0L    /* "No ASH specified" */
  494. #define ASASHMASK    0x7FFFFFFFFFFFFFFFL    /* Valid ASH bits */
  495.  
  496. #define ASBADPRID    -1L    /* An invalid project ID */
  497. #define ASMINPRID    0L    /* Smallest valid project ID */
  498. #define ASNOPRID    0L    /* "No project ID specified" */
  499. #  endif
  500.  
  501. #else
  502. /* Bogus values that don't use lint-unfriendly "LL" */
  503. #define ASBADASH    -1
  504. #define ASMINASH    0
  505. #define ASNOASH        0
  506. #define ASASHMASK    0x7FFFFFFF
  507. #define ASBADPRID    -1
  508. #define ASMINPRID    0
  509. #define ASNOPRID    0
  510. #endif
  511.  
  512.  
  513. /*
  514.  * Miscellaneous functions
  515.  */
  516. const char *asgetattr(const char *, const char **, int);
  517.  
  518. #endif /* C || C++ */
  519.  
  520. #if defined(_LANGUAGE_C_PLUS_PLUS)
  521. }
  522. #endif
  523.  
  524. #endif  /* !__ARRAYSVCS_H_ */
  525.